﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace JsViewEngine.Demo.Controllers
{
    using JsViewEngine.Demo.Models;

    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            var model = GetModel();

            return View(model);
        }

        private static MoviesViewModel GetModel()
        {
            var model = new MoviesViewModel();
            model.Movies.Add(new MoviesViewModel.Movie { name = "The Red Violin", releaseYear = "1998" });
            model.Movies.Add(new MoviesViewModel.Movie { name = "Eyes Wide Shut", releaseYear = "1999" });
            model.Movies.Add(new MoviesViewModel.Movie { name = "The Inheritance", releaseYear = "1976" });
            return model;
        }

        public ActionResult Razor()
        {
            var model = GetModel();

            return View(model);
        }
    }
}
